package com.wenhai.spring.conversion;

import java.beans.PropertyEditor;

/**
 * {@link PropertyEditor} 示例
 *
 * @author wenhai
 * @date   2020/8/9
 * @see PropertyEditor
 */
public class PropertyEditorDemo {

    public static void main(String[] args) {
        // 模拟 Spring Framework 操作
        // 有段文本 name= 谢文海
        String text = "mame = 谢文海";
        PropertyEditor propertyEditor = new StringToPropertiesPropertyEditor();
        // 传递 String 类型的内容
        propertyEditor.setAsText(text);
        System.out.println(propertyEditor.getValue());
        System.out.println(propertyEditor.getAsText());
    }
}

